//COM对象
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstdlib>


IUnKnown * CreateMyComObj1()
{
    IUnKnown * p = new CMyComObj1; // 堆上创建
    p1->AddRef(); // 引用计数加1
    return p1;
}

void CreateMyComObj1(IUnKnown ** pp)
{
    
}

void main()
{
    _CtrSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

    IUnKnown * p1 = CreateMyComObj1();

    IMath * pMath;
    pMyO->QueryInterface(IMathGuid, (void**)&pMath);
    cout << pMath->Add(1, 2) << endl;// 

    system("pause");// 
}